req = new Array();

function loadXMLDoc(url,reqnum) {
	if (window.XMLHttpRequest) {
		req[reqnum] = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		try {
			req[reqnum] = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				reqn[reqnum] = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (req) {
		if( reqnum == 0 ){
			req[reqnum].onreadystatechange = tagsReqChange;
		} else if( reqnum == 1 ){
			req[reqnum].onreadystatechange = goodsReqChange;
		} else if( reqnum == 2 ){
			req[reqnum].onreadystatechange = pricesReqChange;
		} else if( reqnum == 3 ){
			req[reqnum].onreadystatechange = itemsReqChange;
		} else if( reqnum == 4 ){
			req[reqnum].onreadystatechange = requestReqChange;
		} else if( reqnum == 5 ){
			req[reqnum].onreadystatechange = queriesReqChange;
		}
		req[reqnum].open("GET", url, true);
		req[reqnum].send();
	}else{
		alert('error, no req');
	}
}
function stat(n)
{
	switch (n) {
	case 0:
		return "AJAX: не инициализирован";
		break;
	case 1:
		return "AJAX: открыт";
		break;
	case 2:
		return "AJAX: отправка данных";
		break;
	case 3:
		return "AJAX: получение данных";
		break;
	case 4:
		return "AJAX: данные загружены";
		break;
	default:
		return "AJAX: неизвестное состояние";
	}
}
